#!/bin/bash
#####################################################################
# LNMP is a bash script for the installation of Nginx + PHP + MySQL.#
# Author        Hehl <1181554113@qq.com>                            #
# Blog          Http://www.cnblogs.com/ddif                         #
#####################################################################

pushd $src_dir
[ ! -d $java_version ] &&  tar zxf $java_gz
mv $java_version $java_install_dir
cd $java_install_dir

echo "" >> ~/.bash_profile
echo "JAVA_HOME=$java_install_dir" >> ~/.bash_profile
echo "export JRE_HOME=${java_install_dir}/jre" >> ~/.bash_profile
echo 'export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH' >> ~/.bash_profile
echo 'export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH' >> ~/.bash_profile
echo "" >> ~/.bash_profile

source ~/.bash_profile

popd